package pers.cyril.study.graphql.demo.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import pers.cyril.study.graphql.demo.dao.AddressDao;
import pers.cyril.study.graphql.demo.entity.Area;
import pers.cyril.study.graphql.demo.entity.City;
import pers.cyril.study.graphql.demo.entity.Province;

import java.util.List;

/**
 * 说点什么吧
 *
 * @author Wang Cyril
 * @date 2024/7/2 22:02
 */
@Service
public class AddressServiceImpl implements AddressService{

    @Autowired
    private AddressDao addressDao;

    @Override
    public List<Province> getProvinces() {
        return addressDao.getAll();
    }

    @Override
    public Province getProvince(String code) {
        return addressDao.getProvince(code);
    }

    @Override
    public City getCity(String code) {
        return addressDao.getCity(code);
    }

    @Override
    public Area getArea(String code) {
        return addressDao.getArea(code);
    }

    @Override
    public List<City> getCitiesByPCode(String pCode) {
        return addressDao.getCitiesByPCode(pCode);
    }

    @Override
    public List<Area> getAreasByPcode(String pCode) {
        return addressDao.getAreasByPcode(pCode);
    }
}
